package newPan3d.content.ground.groundUp
{
	import _Pan3D.core.MathCore;
	import _Pan3D.program.Program3DManager;
	
	import _me.Scene_data;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display3D.Context3D;
	import flash.display3D.Program3D;
	import flash.events.Event;
	import flash.geom.Rectangle;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	
	import newPan3d.content.ground.NewGroundShader;
	import newPan3d.content.ground.groundUp.GroundUpDisplay3DSprite;
	
	import robotleMvc.frameworks.GroundDisplay3DContainer;
	
	import test.vo.StatVO;

	public class GroundUpLevel
	{
		private var _groundContainer:GroundDisplay3DContainer;
		private var _context3D:Context3D;
		private var _groundItem:Array;
		private var _groundPicBmp:BitmapData;
		
		[Embed(source="../_File/nijia2/ground/loadInfo.jpg")]
		private static var pic:Class;
		
		public function GroundUpLevel()
		{
			_groundContainer=new GroundDisplay3DContainer();
			_context3D=Scene_data.context3D;
			addPicMakeGroundDisplay3D();
			
		}
		private function addPicMakeGroundDisplay3D():void
		{
			
			_groundPicBmp=new BitmapData(100,100,false,0x000000);
			//	var kk:BitmapData=Bitmap(new pic()).bitmapData
			_groundPicBmp.draw(Bitmap(new pic()).bitmapData);
			_groundPicBmp.fillRect(new Rectangle(42,42,10,10),0xff0000)
			
			var sprite3D:GroundUpDisplay3DSprite =new GroundUpDisplay3DSprite(_context3D);
			sprite3D.groundPicBmp=_groundPicBmp;
			sprite3D.url ="baseGround_picGround";
			sprite3D.x=0;
			sprite3D.y=-9;
			sprite3D.z=0;
			sprite3D.scale=1;
			_groundContainer.addChild(sprite3D);
			
			var treeShaderProgram3d:Program3D = Program3DManager.getInstance().getProgram( GroundUpShader.GROUND_UP_SHADER);
			
			_groundContainer.setProgram3D(treeShaderProgram3d);
			

			
		}
		public function upData():void
		{
			_groundContainer.update();
			
			
		}
	}
}